package com.ruoyi.yanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yanjing.mapper.SafetyDocumentLearningRecordMapper;
import com.ruoyi.yanjing.domain.SafetyDocumentLearningRecord;
import com.ruoyi.yanjing.service.ISafetyDocumentLearningRecordService;

/**
 * 学习记录Service业务层处理
 * 
 * @author whz
 * @date 2024-12-04
 */
@Service
public class SafetyDocumentLearningRecordServiceImpl implements ISafetyDocumentLearningRecordService 
{
    @Autowired
    private SafetyDocumentLearningRecordMapper safetyDocumentLearningRecordMapper;

    /**
     * 查询学习记录
     * 
     * @param id 学习记录主键
     * @return 学习记录
     */
    @Override
    public SafetyDocumentLearningRecord selectSafetyDocumentLearningRecordById(Long id)
    {
        return safetyDocumentLearningRecordMapper.selectSafetyDocumentLearningRecordById(id);
    }

    /**
     * 查询学习记录列表
     * 
     * @param safetyDocumentLearningRecord 学习记录
     * @return 学习记录
     */
    @Override
    public List<SafetyDocumentLearningRecord> selectSafetyDocumentLearningRecordList(SafetyDocumentLearningRecord safetyDocumentLearningRecord)
    {
        return safetyDocumentLearningRecordMapper.selectSafetyDocumentLearningRecordList(safetyDocumentLearningRecord);
    }

    /**
     * 新增学习记录
     * 
     * @param safetyDocumentLearningRecord 学习记录
     * @return 结果
     */
    @Override
    public int insertSafetyDocumentLearningRecord(SafetyDocumentLearningRecord safetyDocumentLearningRecord)
    {
        safetyDocumentLearningRecord.setCreateTime(DateUtils.getNowDate());
        return safetyDocumentLearningRecordMapper.insertSafetyDocumentLearningRecord(safetyDocumentLearningRecord);
    }

    /**
     * 修改学习记录
     * 
     * @param safetyDocumentLearningRecord 学习记录
     * @return 结果
     */
    @Override
    public int updateSafetyDocumentLearningRecord(SafetyDocumentLearningRecord safetyDocumentLearningRecord)
    {
        safetyDocumentLearningRecord.setUpdateTime(DateUtils.getNowDate());
        return safetyDocumentLearningRecordMapper.updateSafetyDocumentLearningRecord(safetyDocumentLearningRecord);
    }

    /**
     * 批量删除学习记录
     * 
     * @param ids 需要删除的学习记录主键
     * @return 结果
     */
    @Override
    public int deleteSafetyDocumentLearningRecordByIds(Long[] ids)
    {
        return safetyDocumentLearningRecordMapper.deleteSafetyDocumentLearningRecordByIds(ids);
    }

    /**
     * 删除学习记录信息
     * 
     * @param id 学习记录主键
     * @return 结果
     */
    @Override
    public int deleteSafetyDocumentLearningRecordById(Long id)
    {
        return safetyDocumentLearningRecordMapper.deleteSafetyDocumentLearningRecordById(id);
    }
}
